<ix-modal-header
  [requiredRoles]="requiredRoles"
  [title]="'NVMe-oF Global Configuration' | translate"
  [loading]="isLoading()"
></ix-modal-header>

<mat-card>
  <mat-card-content>
    <form class="ix-form-container" [formGroup]="form" (submit)="onSubmit()">
      <ix-fieldset>
        <ix-input
          formControlName="basenqn"
          [label]="'Base NQN' | translate"
          [tooltip]="helptext.baseNqnTooltip | translate"
        ></ix-input>

        <ix-checkbox
          formControlName="ana"
          [label]="'Enable Asymmetric Namespace Access' | translate"
        ></ix-checkbox>

        <ix-checkbox
          formControlName="rdma"
          [label]="'Enable Remote Direct Memory Access (RDMA)' | translate"
          [tooltip]="helptext.rdmaTooltip"
          [matTooltip]="form.controls.rdma.disabled ? (helptext.rdmaDisabledTooltip | translate) : ''"
        ></ix-checkbox>

        <ix-checkbox
          formControlName="xport_referral"
          [label]="'Generate Cross-port Referrals for Ports On This System ' | translate"
          [tooltip]="helptext.xportReferralTooltip"
        ></ix-checkbox>
      </ix-fieldset>

      <ix-form-actions>
        <button
          *ixRequiresRoles="requiredRoles"
          mat-button
          type="submit"
          color="primary"
          ixTest="save"
          [disabled]="form.invalid || isLoading()"
        >
          {{ 'Save' | translate }}
        </button>
      </ix-form-actions>
    </form>
  </mat-card-content>
</mat-card>
